<template>
  <el-dialog
    :title="title"
    center
    :visible.sync="open"
    @close="close()"
    append-to-body
  >
    <div class="discountReceipt-pick-operate-box">
      <div class="operate-box-bottom">
        <div class="bottom-content">
          <kv-config
            ref="paramsTable"
            :paramType="2"
            paramKey=""
            :disabled="disabled"
          />
        </div>
      </div>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="close">{{
        $t("common.confirm")
      }}</el-button>
      <el-button @click="close">{{ $t("common.cancel") }}</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { dialogMixin } from "@/libs/dialogMixin";
import KvConfig from "@/views/batch/components/kvConfig";
export default {
  name: "EditActuatorParams",
  mixins: [dialogMixin],
  components: { KvConfig },
  data() {
    return {
      open: false,
      sysConfId: "",
      actuatorId: "",
      disabled: false,
      title: "",
    };
  },
  methods: {
    show(actuatorId, sysConfId, disabled = false) {
      this.actuatorId = actuatorId;
      this.sysConfId = sysConfId;
      this.disabled = disabled;

      if (actuatorId) {
        this.title = this.$t("batch.systemConfig.form.editActuator");
        this.$nextTick(() => {
          this.$refs.paramsTable.loadData(actuatorId);
        });
      } else {
        this.title = this.$t("batch.systemConfig.form.addActuator");
      }
      this.open = true;
    },
  },
};
</script>

<style scoped>
</style>
